import { Session } from '/@/utils/storage';
export const tableOption = {
  border: true,
  index: true,
  indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  align: 'center',
  searchMenuSpan: 4,
  searchSpan:5,
  labelWidth: '160',
  indexWidth: '60',
  columnBtn: false,
  editBtn:false,
  delBtn:false,
  selection: true,
  searchEnter:true,
  searchLabelWidth: 'auto',
  searchMenuPosition: 'left',
  column: [
    {
      // type: 'radio',
      label: '巡检模式',
      hide: true,
      prop: 'routeMoudle',
      editDisplay: false,
      rules: [{ required: true, message: '请选择巡检模式', trigger: 'blur' }]
    },
    {
      type: 'input',
      label: '巡检单号',
      prop: 'checkNo',
      width: 180,
      // search: true,
      overHidden: true,
      addDisplay: false,
      editDisabled: true
    },
    {
      // type: 'select',
      label: '巡检计划',
      prop: 'planNo',
      width: 180,
      overHidden: true
    },
    {
      type: 'select',
      label: '巡检路线',
      prop: 'routeId',
      dicUrl: '/api/admin/omicheckroute/list',
      dicHeaders: {
        authorization: 'Bearer ' + Session.get('token'),
      },
      props: {
        label: 'routeName',
        value: 'irId'
      },
      filterable:true,
      rules: [{ required: true, message: '请选择巡检路线', trigger: 'blur' }],
      search: true,
      overHidden: true,
      width: 180
    },

    {
      type: 'input',
      label: '巡检名称',
      prop: 'checkName',
      search: true,
      overHidden: true,
      rules: [{ required: true, message: '请输入巡检名称', trigger: 'blur' }]
      // width: 100
    },
    {
      type: 'tree',
      label: '巡检部门',
      prop: 'checkDeptId',
      filterable: true,
      width: 100,
      props: {
        label: 'name',
        value: 'id'
      },
      cascader: ['checkUserId', 'userRelList'],
      dicUrl: `/api/admin/dept/tree`,
      dicHeaders: {
        authorization: 'Bearer ' + Session.get('token'),
      },
      hide: true,
      rules: [{ required: true, message: '请选择巡检部门', trigger: 'blur' }]
      // search: true
    },
    {
      type: 'select',
      label: '巡检人',
      prop: 'checkUserId',
      props: {
        label: 'name',
        value: 'userId'
      },
      filterable:true,
      dicUrl: `/api/admin/user/page/?deptId={{key}}`,
      dicFormatter: (data) => {
        return data.data.records
      },
      dicHeaders: {
        authorization: 'Bearer ' + Session.get('token'),
      },
      // rules: [{ required: true, message: '请选择巡检人', trigger: 'blur' }],
      formslot: true,
      hide: true
      // search: true
    },
    // {
    //   type: 'input',
    //   label: '巡检人',
    //   prop: 'checkUserName',
    //   hide: true,
    //   search: true,
    //   addDisplay: false,
    //   editDisplay: false
    // },
    {
      type: 'input',
      label: '巡检人电话',
      prop: 'checkUserPhone',
      // width: 180,
      hide: true
    },
    {
      type: 'select',
      label: '其他巡检人员',
      prop: 'userRelList',
      dataType: 'array',
      multiple: true,
      props: {
        label: 'name',
        value: 'userId'
      },
      filterable:true,
      dicUrl: `/api/admin/user/page/?deptId={{key}}`,
      dicFormatter: (data) => {
        return data.data.records
      },
      dicHeaders: {
        authorization: 'Bearer ' + Session.get('token'),
      },
      hide: true
    },
    {
      type: 'input',
      label: '巡检人',
      prop: 'checkUserName',
      search: true,
      addDisplay: false,
      editDisplay: false,
      width: 130
    },

    {
      // type: 'time',
      label: '执行开始时间',
      prop: 'excuteStartTime',
      width: 110
    },
    {
      // type: 'time',
      label: '执行结束时间',
      prop: 'excuteEndTime',
      width: 110
    },
    {
      type: 'input',
      label: '签到时间',
      prop: 'startTime',
      hide: true,
      addDisplay: false,
      editDisabled: true
      // width: 180
    },
    {
      type: 'input',
      label: '结束时间',
      prop: 'endTime',
      hide: true,
      addDisplay: false,
      editDisabled: true
      // width: 180
    },
    {
      type: 'select',
      label: '巡检单状态',
      prop: 'sheetStatus',
      dicUrl: '/api/admin/omodict/item/select?dictKey=sheet_status',
      dicHeaders: {
        authorization: 'Bearer ' + Session.get('token'),
      },
      props: {
        label: 'label',
        value: 'value'
      },
      filterable:true,
      addDisplay: false,
      editDisabled: true,
      searchLabelWidth: '90',
      search: true,
      width: 100
    }
    // {
    //   type: 'input',
    //   label: '创建人',
    //   prop: 'createBy',
    //   addDisplay: false,
    //   editDisabled: true
    // },
    // {
    //   type: 'input',
    //   label: '创建时间',
    //   prop: 'createTime',
    //   addDisplay: false,
    //   editDisabled: true,
    //   width: 180
    // },
    // {
    //   type: 'input',
    //   label: '更新人',
    //   prop: 'updateBy',
    //   addDisplay: false,
    //   editDisabled: true
    // },
    // {
    //   type: 'input',
    //   label: '更新时间',
    //   prop: 'updateTime',
    //   addDisplay: false,
    //   editDisabled: true,
    //   width: 180
    // }
  ]
}
